<UserControl xmlns:my="clr-namespace:SMS.Controls;assembly=SMS.Controls"
             x:Class="SMS.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d"
             d:DesignWidth="840"
             d:DesignHeight="300">

    <Grid x:Name="LayoutRoot"
          Style="{StaticResource LayoutRootGridStyle}">
        <Grid.Projection>
            <PlaneProjection RotationX="-85"
                             x:Name="projection" />
        </Grid.Projection>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Border x:Name="BrandingBorder">
                <Grid Height="40">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0" />
                        <ColumnDefinition Width="*" />

                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0"
                          HorizontalAlignment="Left">
                        <!--<StackPanel Orientation="Horizontal"
                                    HorizontalAlignment="Stretch">
                            <TextBlock x:Name="ApplicationNameTextBlock"
                                       Style="{StaticResource ApplicationNameStyle}"
                                       Text="eShopping System"
                                       HorizontalAlignment="Left" />
                            <ContentControl Style="{StaticResource NavLogoIcon}" />

                        </StackPanel>-->
                    </Grid>

                    <Grid Grid.Column="1"
                          HorizontalAlignment="Left"
                          VerticalAlignment="Center">
                        <StackPanel HorizontalAlignment="Left">
                            <TextBlock  Text="{Binding WelcomeMsg}"
                                        Margin="10,0,0,0"
                                        Style="{StaticResource ContentTextStyle}"
                                        Foreground="White"
                                        FontWeight="Bold"></TextBlock>
                        </StackPanel>
                    </Grid>

                    <Grid  Grid.Column="1"
                           HorizontalAlignment="Right">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="20*" />
                            <RowDefinition Height="20*" />
                        </Grid.RowDefinitions>
                        <!--Background="#FF8AB801"-->

                        <StackPanel Orientation="Horizontal"
                                    VerticalAlignment="Stretch"
                                    HorizontalAlignment="Stretch"
                                    Grid.RowSpan="2">
                            <Image Source="{Binding ImageUrl, Mode=TwoWay}" ></Image>
                            <HyperlinkButton Content="{Binding LoggedInUserDetail}"
                                             VerticalAlignment="Bottom"
                                             Style="{StaticResource DefaultHyperlinkButtonStyle2}"
                                             NavigateUri="/User/UserSettingsMDI"
                                             TargetName="ContentFrame"
                                             FontWeight="Bold"
                                             Foreground="Blue"
                                             FontSize="14"
                                             Command="{Binding ProfileSettingsCommand}"
                                             Margin="5"></HyperlinkButton>
                            <TextBlock Text="|"
                                       VerticalAlignment="Bottom"
                                       Margin="5"></TextBlock>
                            <HyperlinkButton Style="{StaticResource DefaultHyperlinkButtonStyle2}"
                                             VerticalAlignment="Bottom"
                                             FontWeight="Bold"
                                             Foreground="Blue"
                                             Margin="5"
                                             Command="{Binding LogoutCommand}"
                                             FontSize="14"
                                             Content="Sign out" />
                        </StackPanel>
                    </Grid>

                </Grid>
            </Border>
            <Border x:Name="LinksBorder"
                    Grid.Row="1"
                    Style="{StaticResource NavLinksBorderStyle}">
                <StackPanel x:Name="LinksStackPanel"
                            Style="{StaticResource LinksStackPanelStyle}">
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     NavigateUri="SalesModule/SalePage"
                                     TargetName="ContentFrame"
                                     Content="sale" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     NavigateUri="Tracking/TrackingPage"
                                     TargetName="ContentFrame"
                                     Content="tracking" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     TargetName="ContentFrame"
                                     Content="product" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     Visibility="{Binding IsVisibleAdminHyperLink}"
                                     NavigateUri="Reports/ReportMDI"
                                     TargetName="ContentFrame"
                                     Content="report" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     Visibility="{Binding IsVisibleAdminHyperLink}"
                                     NavigateUri="Admin/AdminMDI"
                                     TargetName="ContentFrame"
                                     Content="admin" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     Visibility="{Binding IsVisibleAdminHyperLink}"
                                     NavigateUri="Master/MainMaster"
                                     TargetName="ContentFrame"
                                     Content="master" />
                    <HyperlinkButton Style="{StaticResource LinkStyle}"
                                     Visibility="{Binding IsVisibleAdminHyperLink}"
                                     NavigateUri="AppHealth/AppHealth"
                                     TargetName="ContentFrame"
                                     Content="health" />

                </StackPanel>

            </Border>

            <Border x:Name="ContentBorder"
                    Style="{StaticResource NavContentBorderStyle}"
                    Grid.Row="2">
                <navigation:Frame x:Name="ContentFrame"
                                  Style="{StaticResource NavContentFrameStyle}"
                                  Navigated="ContentFrame_Navigated"
                                  NavigationFailed="ContentFrame_NavigationFailed" />

            </Border>

        </Grid>

    </Grid>
</UserControl>